home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
machack
/
Hacks97
/
WarriorsProgress.sit
/
Warrior’s Progress
/
source code
/
Source
/
Libraries
/
ListTestView.cp
next >
Wrap
Text File
|
1997-06-28
|
876b
|
45 lines
// ListTestView.cp
#ifndef ListTestView_h
#include "ListTestView.h"
#endif
#ifndef ForegroundColorMaintainer_h
#include "ForegroundColorMaintainer.h"
#endif
#ifndef ViewMap_h
#include "ViewMap.h"
#endif
ListTestView::ListTestView()
: cell( 0 )
{
SetCellHeight( 2 );
AddedCells( Range<uint32>( 0, 256 ) );
}
const ViewCell& ListTestView::operator[]( uint32 index ) const
{
const_cast<ColorCell&>(cell) = ColorCell( index );
return cell;
}
ViewCell& ListTestView::operator[]( uint32 index )
{
cell = ColorCell( index );
return cell;
}
ListTestView::ColorCell::ColorCell( uint32 index )
{
Assert( index < 256 );
color.red = index * 0x101;
color.green = index * 0x000;
color.blue = index * 0x101;
}
void ListTestView::ColorCell::Draw( const ViewMap& map ) const
{
ForegroundColorMaintainer cm( color );
PaintRect( &map.VisibleBounds() );
}